using System;
using System.Linq;
using System.Linq.Expressions;

namespace EPiBoost.Core.Infrastructure.Interfaces.Repositories
{
    public interface IRepository
    {
        IQueryable<TEntity> GetQuery<TEntity>() where TEntity : class;
        IQueryable<TEntity> GetAll<TEntity>() where TEntity : class;
        IQueryable<TEntity> Find<TEntity>(Expression<Func<TEntity, bool>> predicate) where TEntity : class;
        TEntity Single<TEntity>(Expression<Func<TEntity, bool>> predicate) where TEntity : class;
        TEntity First<TEntity>(Expression<Func<TEntity, bool>> predicate) where TEntity : class;
        void Add<TEntity>(TEntity entity) where TEntity : class;
        void Delete<TEntity>(TEntity entity) where TEntity : class;
        void Attach<TEntity>(TEntity entity) where TEntity : class;
        void SaveChanges(); 
        void CancelChanges();
        bool DisableCacheing { get; set; }
    }
}